package com.zzq.demo.tom.table;

import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Index;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.annotation.Unique;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@Table(name = "tt_model")
public class Model{

    @Column(name = "id", type = MySqlTypeConstant.BIGINT, length = 20, isKey = true, isNull = false, isAutoIncrement = true, comment = "自增主键")
    private Long id;

    @Unique(name = "uni_1", value = {"id", "uuid"})
    @Column(name = "uuid", type = MySqlTypeConstant.VARCHAR, length = 36, isNull = false, comment = "uuid")
    private String uuid;

    @Index(name = "idx_1", value = {"num"})
    @Column(name = "num", type = MySqlTypeConstant.BIGINT, length = 20, isNull = false, comment = "编号")
    private Long num;

    @Column(name = "status", type = MySqlTypeConstant.INT, length = 3, isNull = false, defaultValue = "1", comment = "状态 0-不可用 1-可用")
    private Integer status;

    @Column(name = "is_delete", type = MySqlTypeConstant.BIT, length = 1, defaultValue = "b'0'", comment = "是否删除")
    private Boolean isDelete;

    @Column(name = "price", type = MySqlTypeConstant.DECIMAL, length = 11, decimalLength = 2, isNull = false, defaultValue = "0.00", comment = "金额")
    private BigDecimal price;

    @Column(name = "remark", type = MySqlTypeConstant.LONGTEXT, comment = "备注")
    private String remark;

    @Column(name = "name", type = MySqlTypeConstant.VARCHAR, length = 100, isNull = false, comment = "名称")
    private String name;

    @Column(name = "time", type = MySqlTypeConstant.DATETIME, comment = "时间")
    private Date time;

//    @Column(name = "ctime", type = MySqlTypeConstant.DATETIME, comment = "创建时间")
//    private Date ctime;

}